package com.prs.crm.dao.warning.impl;

import java.util.ArrayList;
import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;
import org.springframework.orm.hibernate3.HibernateCallback;

import com.prs.crm.dao.impl.BaseDaoImpl;
import com.prs.crm.dao.warning.TaskRemindDao;
import com.prs.crm.domain.warning.TaskRemind;
import com.prs.crm.domain.warning.WarnContent;
import com.prs.crm.service.warning.WarnContentService;
import com.prs.crm.tools.Datetools;

/**
 * @author JohnLan
 * @time：2012-11-22 
 * @version 1.0
 * 类说明
 */

public class TaskRemindDaoImpl extends BaseDaoImpl<TaskRemind> implements
		TaskRemindDao {
	private WarnContentService warnContentService;
	private Datetools dt=new Datetools();
	
	/**
	 * 查询
	 */
	@SuppressWarnings("unchecked")
	public List<TaskRemind> getTaskRemind() {
		return  (List<TaskRemind>) this.getHibernateTemplate().execute(
				new HibernateCallback() {
					public Object doInHibernate(Session session)
							throws HibernateException {
						List<TaskRemind> remindList=new ArrayList<TaskRemind>();
						Criteria criteria = session.createCriteria(TaskRemind.class);
						criteria.add(Restrictions.eq("reState","1"));	//没有进行提醒
						remindList=criteria.list();//没有进行过滤的集合
						

						
					
						return remindList;
					}
				});
	} 
	
	
	public WarnContentService getWarnContentService() {
		return warnContentService;
	}
	public void setWarnContentService(WarnContentService warnContentService) {
		this.warnContentService = warnContentService;
	}


	public Datetools getDt() {
		return dt;
	}


	public void setDt(Datetools dt) {
		this.dt = dt;
	}
	
}
